package com.cloudfun.campusshare.common.constant;

/**
 * @author : ashsr.zhang
 * @date : 2020/3/3 17:11
 * @Version : v1.0
 * @description  项目状态
 **/
public enum ProjectStatus {
    PREPARE(0,"准备中"),
    BUSINESS(1,"运营中"),
    END(2,"已结束");

    private Integer code;
    private String message;

    ProjectStatus(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static ProjectStatus getStatusByCode(Integer code){
        if(code == null){
            return null;
        }
        ProjectStatus[] values = ProjectStatus.values();
        for(ProjectStatus project : values){
            if(code.equals(project.code)){
                return project;
            }
        }
        return null;
    }
}
